#include <string>
using namespace std;

#include "typedefs.h"
design_entity toDesign_Entity(string type) {
	if(type == "procedure")
		return procedure;
	if(type == "stmtLst")
		return stmtLst;
	if(type == "stmt") 
		return stmt;
	if(type == "assign") 
		return assign;
	if(type == "call") 
		return call;
	if(type == "while")
		return while_;
	if(type == "if") 
		return if_;
	if(type=="variable") 
		return variable;
	return invalidDesign_Entity;
}

attr_Name toAttrName(string name) {
	if(name == "procName") 
		return procName;
	if(name == "varName")
		return varName;
	if(name == "value")
		return value;
	if(name == "stmt#")
		return stmtNum;
	return noAttribute;
}

relationType toRelationType(string type) {
	if(type == "Modifies")
		return modifies;
	if(type == "Uses")
		return uses;
	if(type == "Calls")
		return calls;
	if(type == "Calls*")
		return callsT;
	if(type == "Parent")
		return parent;
	if(type == "Parent*")
		return parentT;
	if(type == "Follows")
		return follows;
	if(type == "Follows*")
		return followsT;
	if(type == "Next")
		return next_;
	if(type == "Next*")
		return nextT;
	if(type == "Affects")
		return affects;
	if(type == "Affects*")
		return affectsT;
}
